#include "./carcontrol/car_control.h"

int main()
{
	int ret = 0,in;
	GPIO lw_gpioA = {82,0,OUT};
	GPIO lw_gpioB = {27,0,OUT};
	GPIO rw_gpioA = {28,0,OUT};
	GPIO rw_gpioB = {81,0,OUT};
	PWM  lw_can = {3,0,20000,50000};
	PWM  rw_can = {4,0,20000,50000};
	car_cfg car_cfg = {
		&lw_gpioA,
		&lw_gpioB,
		&rw_gpioA,
		&rw_gpioB,
		&lw_can,
		&rw_can
	};
	robot_car car = {&car_cfg};
	ret = car_init(&car);	
	ret = car_move_on(&car);
	printf("move on res:%d wait for intput............\r\n",ret);
	scanf("%d",&in);
	
	ret = car_back_up(&car);
	printf("back up res:%d wait for input............\r\n",ret);	
	scanf("%d",&in);
	
	ret = car_stop(&car);
	printf("stop car res:%d wait for input............\r\n",ret);
	scanf("%d",&in);
	ret = car_uninit(&car);
	printf("over\r\n");
	return 0;
}



